package com.weibo.boot.springbootlearn.mq.kafka;

import com.alibaba.fastjson.JSON;
import lombok.extern.slf4j.Slf4j;
import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.stereotype.Component;


/**
 * @author panda
 * @version Id: KafkaConsumer, v 0.1 2020/11/29 11:36 上午 Exp $
 * @description
 */
@Component
@Slf4j
public class KafkaConsumer {

   // @KafkaListener(topics = "demo")
    public void consumer(ConsumerRecord<?, ?> record) {
        log.info("kafka消费:{}", JSON.toJSONString(record));
    }
}
